package com.genexususa.eo.connection.google.analytics;

import javax.xml.bind.annotation.*;
import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * User: Nico
 * Date: 19/07/13
 * Time: 04:36 PM
 * To change this template use File | Settings | File Templates.
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "GoogleAnalyticsResult")
public class GoogleAnalyticsResult implements IAPIResult {

    @XmlElement(name = "TotalVisits")
    public float TotalVisits;

    @XmlElement(name = "TotalUniqueVisits")
    public float TotalUniqueVisits;

    @XmlElement(name = "TotalPageviews")
    public float TotalPageviews;

    @XmlElement(name = "TimeOnSite")
    public float TimeOnSite;

    @XmlElement(name = "NewVisits")
    public float NewVisits;

    @XmlElement(name = "Bounces")
    public float Bounces;

    @XmlElement(name = "PagesPerVisit")
    public float PagesPerVisit;

    @XmlElement(name = "AvgVisitDuration")
    public float AvgVisitDuration;

    @XmlElement(name = "BounceRate")
    public float BounceRate;

    @XmlElement(name = "NewVisitsPercentage")
    public float NewVisitsPercentage;

    @XmlElement(name = "TotalNonBrandedVisits")
    public float TotalNonBrandedVisits;

    /*@XmlElement(name = "AssistedConversions")
    public float AssistedConversions; */

    @XmlElement(name = "ViewThroughConversions")
    public float ViewThroughConversions;

    @XmlElement(name = "LastClickConversions")
    public float LastClickConversions;

    @XmlElement(name = "Users")
    public int Users;

    @XmlElement(name = "Sessions")
    public int Sessions;

    @XmlElement(name = "LeadSubmissionsGeneral")
    public int LeadSubmissionsGeneral;

    @XmlElement(name = "LeadSubmissionsService")
    public int LeadSubmissionsService;

    /*@XmlElement(name = "SpecialPageViews")
    public int SpecialPageViews;  */

   /* @XmlElement(name = "SiteEngagementConversions")
    public int SiteEngagementConversions;       */

   /* @XmlElement(name = "DirectionsPageViews")
    public int DirectionPageViews;   */

    /*@XmlElement(name = "TimeGreater2Minutes")
    public int TimeGreater2Minutes;   */



    /*@XmlElement(name = "PageInventoryViews")
    public Long PageInventoryViews; */

    @XmlElement(name = "HasError")
    public boolean HasError;

    @XmlElement (name = "Errors")
    public ErrorsStruct Errors;

    @XmlElementWrapper()
    @XmlElement (name = "PageInventoryView")
    public ArrayList<PageInventoryView> PageInventoryViews;

    @XmlElementWrapper()
    @XmlElement (name = "TimeOnSite")
    public ArrayList<TimeOnSite> Times;

    @XmlElementWrapper()
    @XmlElement (name = "DirectionPageView")
    public ArrayList<Direction> DirectionPageViews;

    @XmlElementWrapper()
    @XmlElement (name = "SpecialPageView")
    public ArrayList<Special> SpecialPageViews;

    @XmlElementWrapper()
    @XmlElement(name = "AssistedConversion")
    public ArrayList<AssistedConversion> AssistedConversions;



    public GoogleAnalyticsResult(){

        this.TotalVisits = 0F;
        this.TotalUniqueVisits = 0F;
        this.TotalPageviews = 0F;
        this.TimeOnSite = 0F;
        this.NewVisits = 0F;
        this.Bounces = 0F;
        this.PagesPerVisit = 0F;
        this.AvgVisitDuration = 0F;
        this.BounceRate = 0F;
        this.NewVisitsPercentage = 0F;
        this.TotalNonBrandedVisits = 0F;
        this.ViewThroughConversions = 0F;
        this.LastClickConversions = 0F;
        this.Users = 0;
        this.Sessions = 0;
        this.PageInventoryViews = new ArrayList<PageInventoryView>();
        this.Times = new ArrayList<TimeOnSite>();
        this.DirectionPageViews =  new ArrayList<Direction>();
        this.SpecialPageViews = new ArrayList<Special>();
        this.AssistedConversions = new ArrayList<AssistedConversion>();

        HasError = false;
    }

}
